/**
 * fulihui.com Inc.
 * Copyright (c) 2015-2016 All Rights Reserved.
 */
package com.fulihui.integral.core.enums;

import org.apache.commons.lang3.StringUtils;
import org.near.toolkit.model.BaseEnum;

/**
 * 查询类型
 *
 * @author yunfeng.li
 * @version $Id: v 0.1 2017年04月27日 14:11 yunfeng.li Exp $
 */
public enum ISAccountQueryType implements BaseEnum {

    MONTH("MONTH", "按月"),

    TODAY("TODAY", "今天"),

    CUSTOM("CUSTOM", "自定义"),;

    private String code;
    private String desc;

    ISAccountQueryType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static ISAccountQueryType getEnumByCode(String code) {
        for (ISAccountQueryType _enum : ISAccountQueryType.values()) {
            if (StringUtils.equals(code, _enum.getCode())) {
                return _enum;
            }
        }
        return null;
    }

    /**
     * 获取枚举代码
     */
    @Override
    public String getCode() {
        return code;
    }

    /**
     * 获取枚举描述
     */
    @Override
    public String getDesc() {
        return desc;
    }

}
